package com.lap.framework.exception;

import java.io.Serial;
import com.lap.framework.dto.result.ErrorCode;
import lombok.Getter;

/**
 * 基础异常类
 *
 * @author Shuisheng Lao(劳水生)
 * @version 0.0.1
 */
@Getter
public abstract class AbstractException extends RuntimeException {
  @Serial
  private static final long serialVersionUID = 7125024153889582291L;

  private final transient ErrorCode errorCode;

  protected AbstractException(ErrorCode errorCode) {
    super(errorCode.getInternalCode());
    this.errorCode = errorCode;
  }
}
